package com.demo15;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;

public class InputStreamDemo2 {
    public static void main(String[] args) throws IOException {
        //读取数据一次性杜腾字节数组的数据
        FileInputStream fis = new FileInputStream("idea_demo\\java\\JavaSE\\javaSE.txt");

        //每次读取指定字节的数据
        byte[] bys = new byte[1024];
        int len;//真正读取到的数据
        while ((len = fis.read(bys)) != -1){
            System.out.println(new String(bys,0,len));
        }
    }
}
